package org.py.controller;

import org.py.service.IMusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author anyi
 * @since 2025-03-14
 */
@RestController
@RequestMapping("/music")
public class MusicController {
    @Autowired
    private IMusicService musicService;

    @RequestMapping("/getAllMusic")
    public String getAllMusic(@RequestBody String json){
        return musicService.getAllUsers(json);
    }

    @RequestMapping("/getMusicById")
    public String getMusicById(@RequestBody String json){
        return musicService.getUserById(json);
    }

    @RequestMapping("/createMusic")
    public String createMusic(@RequestBody String json){
        return musicService.createUser(json);
    }

    @RequestMapping("/updateMusic")
    public String updateMusic(@RequestBody String json){
        return musicService.updateUser(json);
    }

    @RequestMapping("/deleteMusicByAdmin")
    public String deleteMusic(@RequestBody String json){
        return musicService.deleteUser(json);
    }


}
